package com.zdkj.subway.check.result;

import com.zdkj.subway.check.enums.ResultDetailMsg;
import lombok.Data;

@Data
public class Result {
    private int code;
    private String msg;
    private Object data;

    public Result(){

    }
    public Result(ResultDetailMsg ResultDetailMsg){
        this.code=ResultDetailMsg.getCode();
        this.msg=ResultDetailMsg.getDesc();
    }

    public Result(ResultDetailMsg ResultDetailMsg, Object data){
        this.code=ResultDetailMsg.getCode();
        this.msg=ResultDetailMsg.getDesc();
        this.data=data;
    }

    public Result(ResultDetailMsg ResultDetailMsg, String msg, Object data){
        this.code=ResultDetailMsg.getCode();
        this.msg=msg;
        this.data=data;
    }

    public Result(ResultDetailMsg ResultDetailMsg, String msg){
        this.code=ResultDetailMsg.getCode();
        this.msg=msg;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void appendMsg(String msg) {
        this.msg = this.msg+"["+msg+"]";
    }

    public void setResult(ResultDetailMsg ResultDetailMsg) {
        this.code = ResultDetailMsg.getCode();
        this.msg = ResultDetailMsg.getDesc();
    }

}
